/*
 * @Description: 
 * @Author: 于子续
 * @Date: 2024-09-03 15:54:16
 * @LastEditors: 于子续
 * @LastEditTime: 2024-09-03 15:54:50
 */
package day07;

import java.util.Random;

public class Test_GuessNumber {
    public static void main(String[] args) {
        Random random = new Random();
        int number = random.nextInt(100) + 1;
        while (true) {
            int guess = Integer.parseInt(new StringBuffer().append("请输入你猜的数字:").toString());
            if (guess == number) {
                System.out.println("恭喜你猜对了！");
                break;
            } else if (guess < number) {
                System.out.println("猜小了...");
                return;
            } else {
                System.out.println("猜大了...");
                return;
            }
        }
    }
}
